package com.cn.aam.checaiduo.ui.arouter.section;

import android.content.Context;

import com.alibaba.android.arouter.launcher.ARouter;
import com.cn.aam.checaiduo.Const;
import com.cn.aam.checaiduo.ui.arouter.UIRouter;

/**
 * @author 艹羊
 * @project Checaiduo_Android
 * @date 2017/8/14 下午2:28
 * @description
 */

public class RouterWeb {
    private RouterWeb() {
    }

    public static RouterWeb getInstance() {
        return RouterWeb.Holder.INSTANCE;
    }

    private static class Holder {
        static RouterWeb INSTANCE = new RouterWeb();

    }

    //打开web页面
    public void openWebPage(Context context, String url, String title) {
        ARouter.getInstance().build(UIRouter.WEB.NORMAL)
                .withString(Const.TARGET_URL, url)
                .withString(Const.TARGET_TITLE, title)
                .navigation(context);
    }


    //打开红色标题栏web页面
    public void openRedToolBarPage(Context context, String url, String title) {
        ARouter.getInstance().build(UIRouter.WEB.RED_TOOLBAR)
                .withString(Const.TARGET_URL, url)
                .withString(Const.TARGET_TITLE, title)
                .navigation(context);
    }
}
